//
//  UIScreen+SJAdd.swift
//  SJSwiftKit
//
//  Created by swordjoy on 2017/3/7.
//  Copyright © 2017年 swordjoy. All rights reserved.
//

import Foundation
import UIKit

public extension UIScreen {

    /// 屏幕宽
    public static var width: CGFloat { return UIScreen.main.bounds.size.width }
  
    public static var halfWidth: CGFloat { return UIScreen.width * 0.5 }
  
    /// 屏幕高
    public static var height: CGFloat {
        return UIScreen.main.bounds.size.height
    }
  
    public static var noBarHeight: CGFloat {
        return UIScreen.height - UIScreen.navBarHeight - UIScreen.tabBarHeight
    }
  
    public static var noNavBarHeight: CGFloat {
        return UIScreen.height -  UIScreen.navBarHeight
    }
  
    public static var iPhoneX_top : CGFloat { return UIDevice.isPhoneX ? 24.0 : 0.0}
    public static var iPhoneX_bottom : CGFloat { return UIDevice.isPhoneX ? 34.0 : 0.0}
    
    public static var tabBarHeight: CGFloat {
        return UIDevice.isPhoneX ? 49.0+iPhoneX_bottom : 49.0
    }
  
    public static var navBarHeight: CGFloat {
        return UIDevice.isPhoneX ? 64.0+iPhoneX_top : 64.0
    }
    
}
